package com.eight.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @author 郭坤
 * @since 2023-02-24
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="tbIntegrationHistory", description="会员积分使用实体")
@TableName(value = "tb_integration_history")
public class TbIntegrationHistory implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @TableField(value = "id")
    private Long id;

    @ApiModelProperty(value = "会员ID")
    @TableField(value = "member_id")
    private Integer memberId;

    @ApiModelProperty(value = "创建记录时间")
    @TableField(value = "create_time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "积分变化类型1加  2 减")
    @TableField(value = "change_type")
    private Integer changeType;

    @ApiModelProperty(value = "积分改变数量")
    @TableField(value = "change_count")
    private Integer changeCount;


    @ApiModelProperty(value = "操作备注")
    @TableField(value = "operate_note")
    private String operateNote;

    @ApiModelProperty(value = "积分来源：0->自驾服务消费金额；1->参与官方活动；2->官网或者app顶专车或者个人消费后（路桥费，停车费，税费不计入）")
    @TableField(value = "source_type")
    private Integer sourceType;


    @TableField(exist = false)
    private TbUser tbUser;


    @TableField(exist = false)
    private  String name;
}
